<html manifest="IGNORE.manifest"  lang="zh-CN" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">

<!DOCTYPE html>
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../css/index.css"  th:href="@{${uiPath} + ${appName} + '/css/index.css'}"/>
    <link rel="stylesheet" type="text/css" href="../css/reset.css" th:href="@{${uiPath} + ${appName} + '/css/reset.css'}" />
    <link rel="stylesheet" type="text/css" href="../css/CLSRZ.css"  th:href="@{${uiPath} + ${appName} + '/css/CLSRZ.css'}"/>
    <link rel="stylesheet" type="text/css" href="../css/zdialog.css"  th:href="@{${uiPath} + ${appName} + '/css/zdialog.css'}"/>
    <link rel="stylesheet" type="text/css" href="../css/SJS.css" th:href="@{${uiPath} + ${appName} + '/css/SJS.css'}"/>

    <link rel="stylesheet" type="text/css" href="../css/webuploader.css"  th:href="@{${uiPath} + ${appName} + '/css/webuploader.css'}"/>
    <script type="text/javascript" src="../js/flexible.js" th:src="@{${uiPath} + ${appName} + '/js/flexible.js'}"></script>
</head>
<body>
<div class="rzzong">
    <form id="commentForm" th:action="@{'/workmanUser/workmanInfoSave'}" method="post">
        <div class="gtoubu">
            <a href="CLSSingle.html"><img class="fanhui" src="../images/raw_1503386635.png" alt="" th:src="@{${uiPath} + ${appName} + '/images/raw_1503386635.png'}"></a>
            <p class="biaoti">我的资料</p>
        </div>

        <div class="renzhengtishi">
            <div class="kuaiw"></div>


            <img class="dingweisjs dingweiyixa" src="../images/raw_1503289426.png" alt=""th:src="@{${uiPath} + ${appName} + '/images/raw_1503289426.png'}">
            <div class="citylistdian dingeicish">
                <select class="selecity" name="city" id="type">
                    <option  th:text="${configRegion.regionName}" th:value="${configRegion.regionNumber}"></option>

                    <option th:each="configList,conStat: ${configList}" th:utext="${configList.regionName}" th:value="${configList.regionNumber}"></option>
                </select>
            </div>
            <div class="kuaiw"></div>
            <ul>

                <li class="renzhengtiaos">
                    <p class="zhenshixinxi">从业时长:</p >
                    <input class="shuruguig" type="text" name="industryYear" id="name" placeholder="年为单位，输入整数即可">
                    <input class="shuruguig" type="hidden" name="lng" id="lng" >
                    <input class="shuruguig" type="hidden" name="lat" id="lat" >
                </li>
                <li class="renzhengtiaos">
                    <p class="zhenshixinxi">每平米费用:</p >
                    <input class="shuruguig" type="text" name="mimoney" id="mimoney" placeholder="输入每平米/收费">
                </li>
                <li class="renzhengtiaos">
                    <p class="zhenshixinxi">每天费用:</p >
                    <input class="shuruguig" type="text" name="datemoney" id="datemoney" placeholder="输入每天/收费">
                </li>
                <li class="renzhengtiaos">
                    <p class="zhenshixinxi">设计理念:</p >
                    <textarea class="shuruguig" name="userContent">请输入您的施工理念</textarea>
                </li>

            </ul>
            <div class="kuaiw"> </div>
            <div class="jineng">
                <p class="xuanzejineng"><b>我的技能</b>
                    <span>(点击下面选择)</span></p>
                <div class="gongzxuanz">
                    <div th:each="data,dataState:${typeList}">
                    <input class="gongzonglei" type="checkbox"  th:name="'maninfos['+${dataState.index}+'].gztypeId'"  th:value="${data.id}">
                    <p class="nini" th:text="${data.configType}">泥工</p>
                    </div>
                </div>
                <!--  <div class="gongzholeixign">
                   <p class="yixuanze">已选择:</p>
                 <p class="leixinggognz">泥工  瓦工</p>
                </div>
                     </div> -->
            </div>
            <div id="shctp1">
                <div id="uploader-demo" style="width: 10rem">
                    <div id="filePickerd" class="zhaopianbeijing" style="width: 10rem"></div>
                    <div id="fileList" class="xqtu uploader-list" style="width: 10rem"></div>
                </div>
                <input type="hidden" id="img1" name="imgUrl">

                <!--   <div class="xqtu">
                   <input id="xhdui" class="shanchuantp" type="file" >
                </div>
                <div class="imageBox">
                      <div class="thumbBox"></div>
                      <div class="spinner" style="display: none">Loading...</div>
                 </div>  -->
            </div>

        </div>
    </form>
    <div class="kuaiw"></div>
    <div class="nextx" onclick="save()">
        <p class="nextdd">完成</p>
    </div>
</div>



<script type="text/javascript" src="../js/jquery.min.js" th:src="@{${uiPath} + ${appName} + '/js/jquery.min.js'}"></script>
<script type="text/javascript" src="../js/CLSRZ.js" th:src="@{${uiPath} + ${appName} + '/js/CLSRZ.js'}"></script>
<script type="text/javascript" src="../js/webuploader.min.js" th:src="@{${uiPath} + ${appName} + '/js/webuploader.min.js'}"></script>
<script type="text/javascript" src="../js/zdialog.js" th:src="@{${uiPath} + ${appName} + '/js/zdialog.js'}"></script>
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js" th:src="'http://res.wx.qq.com/open/js/jweixin-1.2.0.js'"></script>

<script th:inline="javascript">
    window.onload = function() {
        initUploader();
    };
    $(document).ready(function(){

        $.ajax({
            type:"post",
            url:"/wxOauth/getSing",
            data:{"url":location.href.split('#')[0]},
            dataType:"json",
            success:function(result){
                wx.config({
                    debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
                    appId: result.data.appId, // 必填，公众号的唯一标识
                    timestamp: result.data.timestamp, // 必填，生成签名的时间戳
                    nonceStr: result.data.noncestr, // 必填，生成签名的随机串
                    signature: result.data.signature,// 必填，签名，见附录1
                    jsApiList: ['getLocation','chooseWXPay'] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
                });
            }
        });
    });

    /*
    /!*获取“分享到朋友圈”按钮点击状态及自定义分享内容接口*!/
    wx.onMenuShareTimeline({
        title: '', // 分享标题
        link: '', // 分享链接
        imgUrl: '', // 分享图标
        success: function () {
            // 用户确认分享后执行的回调函数
        },
        cancel: function () {
            // 用户取消分享后执行的回调函数
        }
    });*/

    wx.ready(function(){
        wx.getLocation({
            type:'wgs84',
            success:function (res) {
                lat = res.latitude;
                lng = res.longitude;
                accuracy = res.accuracy;

                $('#lat').val(lat);
                $('#lng').val(lng);

            }})

    });
    function  save() {
        $.ajax({
            type:'post',
            url:$('#commentForm').attr('action'),
            data:$('#commentForm').serialize(),
            dataType:'json',
            success:function (result) {
                if(result.code==1){
                    $.DialogByZ.Close();
                    $.DialogByZ.Alert({Title: "提交成功", Content:result.data ,BtnL:"确定",BtnR:"取消",FunL:localhref})
                }else{
                    $.DialogByZ.Close();
                    $.DialogByZ.Alert({Title: "提交失败", Content:result.data  ,BtnL:"确定"})
                }
            }
        })

    }
    function initUploader() {
        //百度上传按钮

        var uploader = WebUploader.create({
            // swf文件路径
            swf: '../webuploader-0.1.5/Uploader.swf',
            // 文件接收服务端
            method: 'POST',
            // 选择文件的按钮。可选。
            // 内部根据当前运行是创建，可能是input元素，也可能是flash.
            pick: {
                "id": '#filePickerd',
                "multiple": true
            },
            // 不压缩image, 默认如果是jpeg，文件上传前会压缩一把再上传！
            resize: false,
            // 选完文件后，是否自动上传。
            auto: false,
            // 只允许选择图片文件
            accept: {
                title: '图片文件',
                extensions: 'gif,jpg,jpeg,bmp,png',
                mimeTypes: 'image/*'
            }
        });
        uploader.on('fileQueued', function (file) {
            $.ajax({
                url: 'http://easyjiang.huizhuangfang.com.cn/aliyun/oss/policy',
                type: 'GET',
                dataType: 'jsonp',
                jsonp: 'callback',
                success: function (result) {
                    var suffix = get_suffix(file.name);
                    var random_name = random_string();
                    uploader.options.formData.key = result.dir + '/' + random_name + suffix;
                    uploader.options.formData.policy = result.policy;
                    uploader.options.formData.OSSAccessKeyId = result.OSSAccessKeyId;
                    uploader.options.formData.success_action_status = 200;
                    uploader.options.formData.callback = result.callback;
                    uploader.options.formData.signature = result.signature;
                    uploader.options.server = result.action;
                    uploader.upload();
                },
                error: function (msg) {
                    console.log(msg);
                }
            });
        });
        uploader.on('uploadSuccess', function (file, response) {

            $('#img1').val(response.data.filename).focus();

            $("#fileList").css("background-image", 'url("' + response.data.filename + '")');
            uploader.destroy();
            initUploader();


        });
        uploader.on('uploadError', function (file) {
            console.log('uploadError', file);
        });
    }
    // 根据路径获取后缀
    function get_suffix(filename) {
        var pos = filename.lastIndexOf('.');
        var suffix = '';
        if (pos != -1) {
            suffix = filename.substring(pos);
        }
        return suffix;
    }

    // 随机字符串
    function random_string(len) {
        len = len || 32;
        var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
        var maxPos = chars.length;
        var pwd = '';
        for (i = 0; i < len; i++) {
            pwd += chars.charAt(Math.floor(Math.random() * maxPos));
        }
        return pwd;
    }

    function localhref(){
        alert("1234560");
    }
</script>

</body>
</html>